home *** CD-ROM | disk | FTP | other *** search
/ BMUG Revelations / BMUG Revelations.toast / Programming / Programming Languages / Harvest C / MPW Int & Lib / Interfaces / Values.h < prev    next >
Text File  |  1991-04-17  |  1KB  |  61 lines

  1. /************************************************************
  2.  
  3. Created: Monday, November 21, 1988 at 10:37 AM
  4.     Values.h
  5.     C Interface to the Macintosh Libraries
  6.  
  7.  
  8.  
  9.     Copyright Apple Computer, Inc.    1985-1988
  10.     All rights reserved
  11.  
  12. ************************************************************/
  13.  
  14.  
  15. #ifndef __VALUES__
  16. #define __VALUES__
  17.  
  18. #ifndef __SANE__
  19. #include <SANE.h>
  20. #endif
  21.  
  22. #define BITSPERBYTE 8
  23. #define BITS(type) (BITSPERBYTE * (int)sizeof(type))
  24. #define HIBITS ((short)(1<<BITS(short)-1))
  25. #define HIBITI (1<<BITS(int)-1)
  26. #define HIBITL (1L<<BITS(long)-1)
  27. #define MAXSHORT ((short)~HIBITS)
  28. #define MAXINT (~HIBITI)
  29. #define MAXLONG (~HIBITL)
  30. #define MAXEXTENDED nextextended(inf(),0.0)
  31. #define MAXDOUBLE nextdouble(inf(),0.0)
  32. #define MAXFLOAT nextfloat(inf(),0.0)
  33. #define MINEXTENDED scalb(XMINEXP-1,1.0)
  34. #define MINDOUBLE scalb(DMINEXP-1,1.0)
  35. #define MINFLOAT scalb(FMINEXP-1,1.0)
  36. #define _IEEE 1
  37. #define _XEXPLEN 15
  38. #define _DEXPLEN 11
  39. #define _FEXPLEN 8
  40. #define _HIDDENBIT 1
  41. #define _XHIDDENBIT 0
  42. #define XMINEXP (-16382)
  43. #define DMINEXP (-1021)
  44. #define FMINEXP (-125)
  45. #define XMAXEXP 16384
  46. #define DMAXEXP 1024
  47. #define FMAXEXP 128
  48. #define _LENBASE 1
  49. #define _EXPBASE (1<<_LENBASE)
  50. #define XSIGNIF 64
  51. #define DSIGNIF 53
  52. #define FSIGNIF 24
  53. #define XMAXPOWTWO scalb(XSIGNIF-1,1.0)
  54. #define DMAXPOWTWO scalb(DSIGNIF-1,1.0)
  55. #define FMAXPOWTWO scalb(FSIGNIF-1,1.0)
  56. #define LN_MAXDOUBLE log(MAXDOUBLE)
  57. #define LN_MINDOUBLE log(MINDOUBLE)
  58. #define MAXCOMP (scalb(63,1.0)-1.0)
  59.  
  60. #endif
  61.